export const mapping = {
  null: 'icongeshi_weizhi',
  yasuobao: 'icongeshi_tongyongyasuobao',
  tar: 'icongeshi_yasuobaotar',
  iso: 'icongeshi_yasuobaoiso',
  cab: 'icongeshi_yasuobaocab',
  '7z': 'icongeshi_yasuobaoz',
  rar: 'icongeshi_yasuobaorar',
  tupian: 'icongeshi_tongyongtupian',
  zip: 'icongeshi_yasuobaozip',
  cdr: 'icongeshi_tupiancdr',
  tga: 'icongeshi_tupiantga',
  eps: 'icongeshi_tupianeps',
  dxf: 'icongeshi_tupiandxf',
  emf: 'icongeshi_tupianemf',
  wmf: 'icongeshi_tupianwmf',
  pcx: 'icongeshi_tupianpcx',
  svg: 'icongeshi_tupiansvg',
  psd: 'icongeshi_tupianpsd',
  png: 'icongeshi_tupianpng',
  tif: 'icongeshi_tupiantif',
  bmp: 'icongeshi_tupianbmp',
  gif: 'icongeshi_tupiangif',
  jpg: 'icongeshi_tupianjpg',
  jpeg: 'icongeshi_tupianjpeg',
  shipin: 'icongeshi_tongyongshipin',
  swf: 'icongeshi_shipinswf',
  fla: 'icongeshi_shipinfla',
  flv: 'icongeshi_shipinflv',
  mkv: 'icongeshi_shipinmkv',
  vob: 'icongeshi_shipinvob',
  dat: 'icongeshi_shipindat',
  avi: 'icongeshi_shipinavi',
  mov: 'icongeshi_shipinmov',
  m4v: 'icongeshi_shipinmv',
  mp4: 'icongeshi_shipinmp',
  mpeg: 'icongeshi_shipinmpeg',
  mpe: 'icongeshi_shipinmpe',
  mpg: 'icongeshi_shipinmpg',
  '3gp': 'icongeshi_shipingp',
  rmvb: 'icongeshi_shipinrmvb',
  rm: 'icongeshi_shipinrm',
  asx: 'icongeshi_shipinasx',
  asf: 'icongeshi_shipinasf',
  wmv: 'icongeshi_shipinwmv',
  yinpin: 'icongeshi_tongyongyinpin',
  aac: 'icongeshi_yinpinaac',
  flac: 'icongeshi_yinpinflac',
  midi: 'icongeshi_yinpinmidi',
  ape: 'icongeshi_yinpinape',
  ogg: 'icongeshi_yinpinogg',
  wav: 'icongeshi_yinpinwav',
  wendang: 'icongeshi_tongyongwendang',
  wma: 'icongeshi_yinpinwma',
  mp3: 'icongeshi_yinpinmp',
  xlsx: 'icongeshi_wendangxlsx',
  srt: 'icongeshi_wendangsrt',
  xls: 'icongeshi_wendangxls',
  docx: 'icongeshi_wendangdocx',
  html: 'icongeshi_wendanghtml',
  htm: 'icongeshi_wendanghtm',
  pdf: 'icongeshi_wendangpdf',
  pptx: 'icongeshi_wendangpptx',
  ppt: 'icongeshi_wendangppt',
  doc: 'icongeshi_wendangdoc',
  txt: 'icongeshi_wendangtxt'
}

export function analysisName(name) {
  let result = ''
  const arr = name.split('.')
  result = mapping[arr[arr.length - 1]]
  return result === undefined ? mapping['null'] : result
}

export const auditOption = (that) => {
  return {
    title: '',
    index: true,
    indexLabel: that.$t('processDialog.index'),
    align: 'center',
    menuAlign: 'center',
    border: true,
    delBtn: false,
    editBtn: false,
    addBtn: false,
    dialogEscape: false,
    dialogClickModal: false,
    menu: false,
    refreshBtn: false,
    columnBtn: false,
    emptyText: that.$t('form.emptyText'),
    column: [{
      label: that.$t('processDialog.auditProject'),
      prop: 'nodeName'
    }, {
      label: that.$t('processDialog.auditPerson'),
      prop: 'createUser'
    }, {
      label: that.$t('processDialog.auditTime'),
      prop: 'createTime'
    }, {
      label: that.$t('processDialog.auditOpinion'),
      prop: 'opinion'
    }]
  }
}
